![]() |
Technote 10008Tanzania ÇΔ Cupid ÇÃPS2 ÉLÅ[É{Å[ÉhDžǬǢǃWritten by : KIDA Yasuo (Apple Technology, Inc.)NAGAMATSU Masato (JapanDTS) February 1997
ŰÇÕÇ∂ÇflÇ…Tanzania ÇΔ Cupid Ç≈ÇÕ ADBÉLÅ[É{Å[ÉhÇÃëºÇ…PS2 ÉLÅ[É{Å[ÉhÉCÉìÉ^Å[ÉtÉFÅ[ÉXÇ™ÉTÉ|Å[ÉgÇ≥ÇÍÇÈÇÊǧDžǻÇËNjǵÇΩÇ™ÅAìÒǬÇÃñ‚ëËǙdžÇËÇ‹Ç∑ÅBàÍǬñ⁄ÇÃñ‚ëËÇÕÅAADB ÉLÅ[É{Å[ÉhÇæÇØÇ™ê⁄ë±Ç≥ÇÍǃǢÇÈèÍçáÇ≈LJÅAADB manager ÇÕÅAPS2 ÉLÅ[É{Å[ÉhÅuLJÅvê⁄ë±Ç≥ÇÍǃǢÇÈÇΔï‘ǵNjÇ∑ÅBADB manager Çégǡǃê⁄ë±Ç≥ÇÍǃǢÇÈÉLÅ[É{Å[ÉhÇîªífÇ∑ÇÈÇÊǧǻÉvÉçÉOÉâÉÄÇÕÅA PS2 ÉLÅ[É{Å[ÉhÇà ID Ç≈džÇÈ Åg 1B (Hex)Åh Çå©ÇΩÇΔÇ´Ç…ÇÕÅAíçà”ǵǻÇ≠ǃÇÕÇ»ÇËÇ‹ÇπÇÒÅBDZ ÇÍÇ™óBàÍÇÃÉLÅ[É{Å[ÉhIDÇ»ÇÁÅAǮǪÇÁÇ≠é¿ç€Ç… PS2 ÉLÅ[É{Å[ÉhǙǬǻǙÇÍǃǢÇÈÇΔîªífÇ≈Ç´Ç‹Ç∑ÅBǵǩǵÅAÅg1B (Hex) Åhà»äODžLJÉLÅ[É{Å[ÉhIDÇ™å©Ç¬Ç©Ç¡ÇΩÇ»ÇÁÅAPS2ÉLÅ[É{Å[ÉhÇÕǬǻǙǡǃ ǢǻǢâ¬î\ê´Ç™Ç†ÇËÇ‹Ç∑ÅBADB ÉLÅ[É{Å[ÉhÇæÇØÇ™Ç¬Ç»Ç™Ç¡ÇƒÇ¢ÇÈÇÃÇ©ÅAADB ÇΔ PS2 ÇΔóºï˚ÇÃÉLÅ[É{Å[ÉhǙǬǻǙǡǃǢÇÈÇÃÇ©Çå©ï™ÇØÇÈDZÇΔÇ™Ç≈ǴǻǢÇÃÇ≈Ç∑ÅB
LJǧàÍǬÇÃñ‚ëËÇÕ KbdType low memory global Ç≈Ç∑ÅBÉXÉ^Å[ÉgÉAÉbÉvéûÇ…í èÌÇ»ÇÁ low memory global Çà KbdType ÇÕÅAÉÜÅ[ÉUÅ[Ç™ÉLÅ[Ç…ç≈èâÇ…êGÇÍÇÈëOÇ≈LJÅAê⁄ë±Ç≥ÇÍǃǢÇÈÉLÅ[É{Å[ÉhÇà ID Çê≥ǵÇ≠é¶ÇµÇƒÇ¢Ç‹Ç∑ÅBǵǩǵÅATanzania ÇΔ Cupid Ç≈ÇÕÅAïKÇ∏ PS2 ÉLÅ[É{Å[ÉhÇà ID Ç≈džÇÈÅg1B (Hex)Åh Ç™ì¸Ç¡ÇƒÇ¢Ç‹Ç∑ÅBÉCÉìÉvÉbÉgÉÅÉ\ÉbÉh Ç‚ã@î\ägí£Ç»Ç«Ç≈ÅAÉXÉ^Å[ÉgÉAÉbÉvéûÇ…ÉLÅ[É{Å[ÉhÇ KbdType Çå©ÇÈDZÇΔÇ…ÇÊǡǃ îªífǵǃǢÇÈÉvÉçÉOÉâÉÄÇÕDZÇÃñ‚ëËÇÃâeãøÇéÛÇØÇ‹Ç∑ÅB
Űå¥àˆÇ±ÇÍÇÕ PS2 ÉCÉìÉ^Å[ÉtÉFÅ[ÉXÇ™ ADB ÇÃÇÊǧDž plug & play ÇÉTÉ|Å[ÉgǵǃǢǻǢÇΩÇflÇ≈Ç∑ÅBŰâÒîï˚ñ@à»â∫ÇÃÇÊǧǻï˚ñ@Ç≈ ADB manager ÇégǧDZÇΔÇ…ÇÊǡǃÅAäÆëSÇ≈ÇÕdžÇËÇ‹ÇπÇÒÇ™ÅAñ‚ëËÇÃâeãøÇéÊÇËèúÇ≠DZÇΔ Ç™Ç≈Ç´Ç‹Ç∑ÅB |
enum { kADBAddressKeybaord = 2, kKeyboardTypePS2 = 0x1B }; // See what kind of keyboard is connected int keyboardType = LMGetKbdType(); // Kida 970121 (Bug #1621330) // // On Tanzania and Cupid, ADB manager doesn't know if PS2 keyboard is connected or not. // Even when only an ADB keyboard is connected to those machines (Cupid is not even capable // of connecting PS2 keybaord), ADB manager returns that a PS2 keyboard is also connected. // It is found that, on those machines, at startup before the user touchs any keys on the // keyboard, the KbdType low memory global always sais that the keyboard connected is PS2 // (1B). It makes Kotoeri to put up possiblly a wrong menu depending on what keyboard is // actually connected. // // Workaround the bug by listing all ADB devices by using ADB manager and try to find if // there is non PS2, i.e. ADB, keyboard connected. If so, it assumes that found ADB // keybaord is the real keybaord connected. As the side effect, if both PS2 and ADB is // connected, it always thinks the ADB is the primary keyboard. I think this is OK. // if ( keyboardType == kKeyboardTypePS2 ) // if PS2 keybaord is what I found, doubt if it's // really so and do this hack { int numADBs = CountADBs(); for ( int anADBIndex = 0; anADBIndex < numADBs; ++ anADBIndex ) { ADBDataBlock anADBInfo; GetIndADB( &anADBInfo, anADBIndex ); if ( anADBInfo.origADBAddr == kADBAddressKeybaord ) // if this is a keybaord { if ( anADBInfo.devType != kKeyboardTypePS2 ) // and if the keybaord is // not PS2 { keyboardType = anADBInfo.devType; // it's the real guy break; } } } // if anADBIndex == numADBs at this point, it means the connected keyboard is really PS2 }
![]() |
|